package com.zzyl.zzyltransferserver.controller;

import com.zzyl.zzyltransferserver.constants.RedisQueueTopic;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("test")
public class TestRedisQueueController {

    @Resource
    RedisTemplate<String,Object> redisTemplate;

    @GetMapping("send")
    public void sendMessage(){
        redisTemplate.convertAndSend(RedisQueueTopic.TEST_TOPIC, "hello world");
    }

}
